package core.proto;

import java.io.File;

import javax.swing.tree.DefaultMutableTreeNode;

public class CaseNode extends DefaultMutableTreeNode{
	private boolean visited= false;
	private String abspath="";
	private int isCurrent= 0; //0 is directory, -1 if cold, 1 if hot
	
	/** Constructor: CaseNode(String path, boolean currentCase*/
	CaseNode(String name, String path, int isCurrent){
		super(name);
		visited= false;
		this.abspath=path;
		this.isCurrent= isCurrent;
	}
	
	public boolean isVisited(){
		return visited;
	}
	
	public String getAbsolutePath(){
		return this.abspath;
	}
	
	public int isCurrent(){
		return this.isCurrent;
	}
	
	public void setVisited(boolean a){
		this.visited= a;
	}
	
	//return only the name of the file/dir
	public String toString(){
		File f=new File(this.abspath);
	    return f.getName().length() > 0 ? f.getName() : 
	        f.getPath();
	    }
}
